
//
// Copyright 2009 Arne Halvorsen (arne.halvorsen@gmail.com)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

// Project page: http://code.google.com/p/webfg/

//
// 091201 - aha42 - Created.
// 091211 - aha42 - Renamed. 
//

package org.aha.servlet;

/**
 * <p>
 *   {@link RequestParseException} thrown when service finds a mandatory 
 *   HTTP request parameter is missing.
 * </p>
 * @author Arne Halvorsen (aha42)
 */
@SuppressWarnings("serial")
public final class MissingRequestParameterException
  extends RequestParseException 
{
  private final String m_name;
  
  /**
   * <p>
   *   Constructor.
   * </p>
   * @param name 
   */
  public MissingRequestParameterException(String name)
  {
    super("Missing parameter : "+name);
    
    if (name==null)
    {
      throw new NullPointerException("name");
    }
    
    m_name=name;
  }
  
  /**
   * <p>
   *   Gets name on missing parameter.
   * </p>
   * @return Name.
   */
  public String getName(){ return m_name; }
  
}
